package admin.member.level.action;

import java.sql.SQLException;
import java.util.List;


import admin.member.level.dao.LevelDao;
import admin.member.level.dto.LevelDto;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

@SuppressWarnings("serial")
public class ListAction extends ActionSupport implements Preparable, ModelDriven {
	private LevelDao dao;
	private LevelDto dto;
	private List<LevelDto> levelList;
	
	public ListAction() {
		dao = LevelDao.getInstance();
	}
	
	public String execute() throws SQLException {
		levelList = dao.list();
		
		return SUCCESS;
	}

	public List<LevelDto> getLevelList() {
		return levelList;
	}

	@Override
	public Object getModel() {
		return dto;
	}

	@Override
	public void prepare() throws Exception {
		dto = new LevelDto();
	}
}
